package com.gang.mars.basic.thread;

/**
 * 线程第二课：创建线程，继承Thread
 * 1，线程运行是没有顺序的
 * */
public class Grape002 {

    static class Grape003 extends Thread{

        public Grape003(String threadName){
            super(threadName);
        }

        @Override
        public void run() {
            for (int i = 0; i < 1000; i++) {
                System.out.println(Thread.currentThread().getName()+":"+i);
            }
        }
    }

    public static void main(String[] args) {

        Grape003 t3 = new Grape003("thread-grape003");
        t3.start();

        for (int i = 0; i < 1000; i++) {
            System.out.println(Thread.currentThread().getName()+":"+i);
        }

    }
}
